<template>
	<view class="page-footer" :class="[{shadow,'is-tabbar':isTabbar}]">
		<view class="page-footer-content" :style="[contentStyle]">
			<u-button type="primary" shape="circle" :disabled="disabled" @click="$emit('click')" v-if="!$slots.default">
				<slot name="btnContent"></slot>
			</u-button>
			<slot v-else></slot>
		</view>
	</view>
</template>

<script>
	export default {
		name: "FloatPageFooter",
		props: {
			height: {
				type: [String, Number],
				default: 80
			},
			disabled: {
				type: Boolean,
				default: false
			},
			shadow: {
				type: Boolean,
				default: true
			}
		},
		computed: {
			contentStyle() {
				return {
					height: this.$u.addUnit(this.height)
				}
			},
			isTabbar() {
				return this.$k.hasTabbar();
			}
		},
		created() {

		},

		data() {
			return {

			};
		}
	}
</script>

<style lang="scss" scoped>
	.page-footer {
		position: fixed;
		@include addSafeArea();
		bottom: 0;
		left: 0;
		width: 100%;
		background-color: $u-color-white;
		z-index: 33;

		&.is-tabbar {
			// #ifdef H5
			bottom: 50px;
			// #endif
		}

		&.shadow {
			box-shadow: 0rpx -8rpx 4rpx 0rpx rgba(0, 0, 0, 0.05);
		}

		&-content {
			margin-top: 5rpx;
			padding: 0 30rpx;
		}
	}
</style>